3.2.93 \(\int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx\) [193]

3.2.93.1 Optimal result
3.2.93.2 Mathematica [B] (verified)
3.2.93.3 Rubi [A] (verified)
3.2.93.4 Maple [A] (verified)
3.2.93.5 Fricas [A] (verification not implemented)
3.2.93.6 Sympy [F]
3.2.93.7 Maxima [A] (verification not implemented)
3.2.93.8 Giac [A] (verification not implemented)
3.2.93.9 Mupad [B] (verification not implemented)

3.2.93.1 Optimal result

Integrand size = 21, antiderivative size = 133 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx=\frac {3 a^2 b \text {arctanh}(\sin (c+d x))}{d}+\frac {3 b^3 \text {arctanh}(\sin (c+d x))}{2 d}-\frac {a^3 \cot (c+d x)}{d}-\frac {3 a b^2 \cot (c+d x)}{d}-\frac {3 a^2 b \csc (c+d x)}{d}-\frac {3 b^3 \csc (c+d x)}{2 d}+\frac {b^3 \csc (c+d x) \sec ^2(c+d x)}{2 d}+\frac {3 a b^2 \tan (c+d x)}{d} \]

output
3*a^2*b*arctanh(sin(d*x+c))/d+3/2*b^3*arctanh(sin(d*x+c))/d-a^3*cot(d*x+c) 
/d-3*a*b^2*cot(d*x+c)/d-3*a^2*b*csc(d*x+c)/d-3/2*b^3*csc(d*x+c)/d+1/2*b^3* 
csc(d*x+c)*sec(d*x+c)^2/d+3*a*b^2*tan(d*x+c)/d
 
3.2.93.2 Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(406\) vs. \(2(133)=266\).

Time = 2.44 (sec) , antiderivative size = 406, normalized size of antiderivative = 3.05 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx=-\frac {\csc ^5\left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {1}{2} (c+d x)\right ) \left (12 a^2 b+2 b^3+6 a \left (a^2+2 b^2\right ) \cos (c+d x)+6 \left (2 a^2 b+b^3\right ) \cos (2 (c+d x))+2 a^3 \cos (3 (c+d x))+12 a b^2 \cos (3 (c+d x))+6 a^2 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)+3 b^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)-6 a^2 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)-3 b^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)+6 a^2 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (3 (c+d x))+3 b^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (3 (c+d x))-6 a^2 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (3 (c+d x))-3 b^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (3 (c+d x))\right )}{16 d \left (-1+\cot ^2\left (\frac {1}{2} (c+d x)\right )\right )^2} \]

input
Integrate[Csc[c + d*x]^2*(a + b*Sec[c + d*x])^3,x]
 
output
-1/16*(Csc[(c + d*x)/2]^5*Sec[(c + d*x)/2]*(12*a^2*b + 2*b^3 + 6*a*(a^2 + 
2*b^2)*Cos[c + d*x] + 6*(2*a^2*b + b^3)*Cos[2*(c + d*x)] + 2*a^3*Cos[3*(c 
+ d*x)] + 12*a*b^2*Cos[3*(c + d*x)] + 6*a^2*b*Log[Cos[(c + d*x)/2] - Sin[( 
c + d*x)/2]]*Sin[c + d*x] + 3*b^3*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] 
*Sin[c + d*x] - 6*a^2*b*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]*Sin[c + d 
*x] - 3*b^3*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]*Sin[c + d*x] + 6*a^2* 
b*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]]*Sin[3*(c + d*x)] + 3*b^3*Log[Co 
s[(c + d*x)/2] - Sin[(c + d*x)/2]]*Sin[3*(c + d*x)] - 6*a^2*b*Log[Cos[(c + 
 d*x)/2] + Sin[(c + d*x)/2]]*Sin[3*(c + d*x)] - 3*b^3*Log[Cos[(c + d*x)/2] 
 + Sin[(c + d*x)/2]]*Sin[3*(c + d*x)]))/(d*(-1 + Cot[(c + d*x)/2]^2)^2)
 
3.2.93.3 Rubi [A] (verified)

Time = 0.72 (sec) , antiderivative size = 121, normalized size of antiderivative = 0.91, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3042, 4360, 25, 25, 3042, 25, 3391, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (a-b \csc \left (c+d x-\frac {\pi }{2}\right )\right )^3}{\cos \left (c+d x-\frac {\pi }{2}\right )^2}dx\)

\(\Big \downarrow \) 4360

\(\displaystyle \int \csc ^2(c+d x) \sec ^3(c+d x) \left (-(-a \cos (c+d x)-b)^3\right )dx\)

\(\Big \downarrow \) 25

\(\displaystyle -\int -(b+a \cos (c+d x))^3 \csc ^2(c+d x) \sec ^3(c+d x)dx\)

\(\Big \downarrow \) 25

\(\displaystyle \int \csc ^2(c+d x) \sec ^3(c+d x) (a \cos (c+d x)+b)^3dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int -\frac {\left (b-a \sin \left (c+d x-\frac {\pi }{2}\right )\right )^3}{\sin \left (c+d x-\frac {\pi }{2}\right )^3 \cos \left (c+d x-\frac {\pi }{2}\right )^2}dx\)

\(\Big \downarrow \) 25

\(\displaystyle -\int \frac {\left (b-a \sin \left (\frac {1}{2} (2 c-\pi )+d x\right )\right )^3}{\cos \left (\frac {1}{2} (2 c-\pi )+d x\right )^2 \sin \left (\frac {1}{2} (2 c-\pi )+d x\right )^3}dx\)

\(\Big \downarrow \) 3391

\(\displaystyle -\int \left (-\sec ^2\left (\frac {1}{2} (2 c-\pi )+d x\right ) a^3-3 b \sec (c+d x) \sec ^2\left (\frac {1}{2} (2 c-\pi )+d x\right ) a^2-3 b^2 \sec ^2(c+d x) \sec ^2\left (\frac {1}{2} (2 c-\pi )+d x\right ) a-b^3 \sec ^3(c+d x) \sec ^2\left (\frac {1}{2} (2 c-\pi )+d x\right )\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {a^3 \cot (c+d x)}{d}+\frac {3 a^2 b \text {arctanh}(\sin (c+d x))}{d}-\frac {3 a^2 b \csc (c+d x)}{d}-\frac {6 a b^2 \cot (2 c+2 d x)}{d}+\frac {3 b^3 \text {arctanh}(\sin (c+d x))}{2 d}-\frac {3 b^3 \csc (c+d x)}{2 d}+\frac {b^3 \csc (c+d x) \sec ^2(c+d x)}{2 d}\)

input
Int[Csc[c + d*x]^2*(a + b*Sec[c + d*x])^3,x]
 
output
(3*a^2*b*ArcTanh[Sin[c + d*x]])/d + (3*b^3*ArcTanh[Sin[c + d*x]])/(2*d) - 
(a^3*Cot[c + d*x])/d - (6*a*b^2*Cot[2*c + 2*d*x])/d - (3*a^2*b*Csc[c + d*x 
])/d - (3*b^3*Csc[c + d*x])/(2*d) + (b^3*Csc[c + d*x]*Sec[c + d*x]^2)/(2*d 
)
 

3.2.93.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3391
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n 
_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Int[ExpandTrig 
[(g*cos[e + f*x])^p, (d*sin[e + f*x])^n*(a + b*sin[e + f*x])^m, x], x] /; F 
reeQ[{a, b, d, e, f, g, n, p}, x] && NeQ[a^2 - b^2, 0] && IntegerQ[m] && (G 
tQ[m, 0] || IntegerQ[n])
 

rule 4360
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
(a_))^(m_.), x_Symbol] :> Int[(g*Cos[e + f*x])^p*((b + a*Sin[e + f*x])^m/Si 
n[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]
 
3.2.93.4 Maple [A] (verified)

Time = 1.05 (sec) , antiderivative size = 129, normalized size of antiderivative = 0.97

method result size
derivativedivides \(\frac {-a^{3} \cot \left (d x +c \right )+3 a^{2} b \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+3 a \,b^{2} \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )+b^{3} \left (\frac {1}{2 \sin \left (d x +c \right ) \cos \left (d x +c \right )^{2}}-\frac {3}{2 \sin \left (d x +c \right )}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(129\)
default \(\frac {-a^{3} \cot \left (d x +c \right )+3 a^{2} b \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+3 a \,b^{2} \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )+b^{3} \left (\frac {1}{2 \sin \left (d x +c \right ) \cos \left (d x +c \right )^{2}}-\frac {3}{2 \sin \left (d x +c \right )}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(129\)
parallelrisch \(\frac {-3 \left (1+\cos \left (2 d x +2 c \right )\right ) \left (a^{2}+\frac {b^{2}}{2}\right ) b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+3 \left (1+\cos \left (2 d x +2 c \right )\right ) \left (a^{2}+\frac {b^{2}}{2}\right ) b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-\frac {3 \sec \left (\frac {d x}{2}+\frac {c}{2}\right ) \csc \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\left (2 a^{2} b +b^{3}\right ) \cos \left (2 d x +2 c \right )+\left (\frac {1}{3} a^{3}+2 a \,b^{2}\right ) \cos \left (3 d x +3 c \right )+\left (a^{3}+2 a \,b^{2}\right ) \cos \left (d x +c \right )+2 a^{2} b +\frac {b^{3}}{3}\right )}{4}}{d \left (1+\cos \left (2 d x +2 c \right )\right )}\) \(181\)
norman \(\frac {-\frac {a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}}{2 d}+\frac {\left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{2 d}-\frac {3 \left (a^{3}-a^{2} b +7 a \,b^{2}-b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{2 d}+\frac {3 \left (a^{3}+a^{2} b +7 a \,b^{2}+b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{2 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}-\frac {3 b \left (2 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {3 b \left (2 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) \(216\)
risch \(-\frac {i \left (6 a^{2} b \,{\mathrm e}^{5 i \left (d x +c \right )}+3 b^{3} {\mathrm e}^{5 i \left (d x +c \right )}+2 a^{3} {\mathrm e}^{4 i \left (d x +c \right )}+12 a^{2} b \,{\mathrm e}^{3 i \left (d x +c \right )}+2 b^{3} {\mathrm e}^{3 i \left (d x +c \right )}+4 a^{3} {\mathrm e}^{2 i \left (d x +c \right )}+12 a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+6 a^{2} b \,{\mathrm e}^{i \left (d x +c \right )}+3 b^{3} {\mathrm e}^{i \left (d x +c \right )}+2 a^{3}+12 a \,b^{2}\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{d}-\frac {3 b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}+\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2}}{d}+\frac {3 b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}\) \(262\)

input
int(csc(d*x+c)^2*(a+b*sec(d*x+c))^3,x,method=_RETURNVERBOSE)
 
output
1/d*(-a^3*cot(d*x+c)+3*a^2*b*(-1/sin(d*x+c)+ln(sec(d*x+c)+tan(d*x+c)))+3*a 
*b^2*(1/sin(d*x+c)/cos(d*x+c)-2*cot(d*x+c))+b^3*(1/2/sin(d*x+c)/cos(d*x+c) 
^2-3/2/sin(d*x+c)+3/2*ln(sec(d*x+c)+tan(d*x+c))))
 
3.2.93.5 Fricas [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.14 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx=\frac {3 \, {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - 3 \, {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) + 12 \, a b^{2} \cos \left (d x + c\right ) - 4 \, {\left (a^{3} + 6 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} + 2 \, b^{3} - 6 \, {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2}}{4 \, d \cos \left (d x + c\right )^{2} \sin \left (d x + c\right )} \]

input
integrate(csc(d*x+c)^2*(a+b*sec(d*x+c))^3,x, algorithm="fricas")
 
output
1/4*(3*(2*a^2*b + b^3)*cos(d*x + c)^2*log(sin(d*x + c) + 1)*sin(d*x + c) - 
 3*(2*a^2*b + b^3)*cos(d*x + c)^2*log(-sin(d*x + c) + 1)*sin(d*x + c) + 12 
*a*b^2*cos(d*x + c) - 4*(a^3 + 6*a*b^2)*cos(d*x + c)^3 + 2*b^3 - 6*(2*a^2* 
b + b^3)*cos(d*x + c)^2)/(d*cos(d*x + c)^2*sin(d*x + c))
 
3.2.93.6 Sympy [F]

\[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right )^{3} \csc ^{2}{\left (c + d x \right )}\, dx \]

input
integrate(csc(d*x+c)**2*(a+b*sec(d*x+c))**3,x)
 
output
Integral((a + b*sec(c + d*x))**3*csc(c + d*x)**2, x)
 
3.2.93.7 Maxima [A] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.05 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx=-\frac {b^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{2} - 2\right )}}{\sin \left (d x + c\right )^{3} - \sin \left (d x + c\right )} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, a^{2} b {\left (\frac {2}{\sin \left (d x + c\right )} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, a b^{2} {\left (\frac {1}{\tan \left (d x + c\right )} - \tan \left (d x + c\right )\right )} + \frac {4 \, a^{3}}{\tan \left (d x + c\right )}}{4 \, d} \]

input
integrate(csc(d*x+c)^2*(a+b*sec(d*x+c))^3,x, algorithm="maxima")
 
output
-1/4*(b^3*(2*(3*sin(d*x + c)^2 - 2)/(sin(d*x + c)^3 - sin(d*x + c)) - 3*lo 
g(sin(d*x + c) + 1) + 3*log(sin(d*x + c) - 1)) + 6*a^2*b*(2/sin(d*x + c) - 
 log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) + 12*a*b^2*(1/tan(d*x + c) 
 - tan(d*x + c)) + 4*a^3/tan(d*x + c))/d
 
3.2.93.8 Giac [A] (verification not implemented)

Time = 0.35 (sec) , antiderivative size = 225, normalized size of antiderivative = 1.69 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx=\frac {a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, {\left (2 \, a^{2} b + b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (2 \, a^{2} b + b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} - \frac {2 \, {\left (6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \]

input
integrate(csc(d*x+c)^2*(a+b*sec(d*x+c))^3,x, algorithm="giac")
 
output
1/2*(a^3*tan(1/2*d*x + 1/2*c) - 3*a^2*b*tan(1/2*d*x + 1/2*c) + 3*a*b^2*tan 
(1/2*d*x + 1/2*c) - b^3*tan(1/2*d*x + 1/2*c) + 3*(2*a^2*b + b^3)*log(abs(t 
an(1/2*d*x + 1/2*c) + 1)) - 3*(2*a^2*b + b^3)*log(abs(tan(1/2*d*x + 1/2*c) 
 - 1)) - (a^3 + 3*a^2*b + 3*a*b^2 + b^3)/tan(1/2*d*x + 1/2*c) - 2*(6*a*b^2 
*tan(1/2*d*x + 1/2*c)^3 - b^3*tan(1/2*d*x + 1/2*c)^3 - 6*a*b^2*tan(1/2*d*x 
 + 1/2*c) - b^3*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^2)/d
 
3.2.93.9 Mupad [B] (verification not implemented)

Time = 14.09 (sec) , antiderivative size = 181, normalized size of antiderivative = 1.36 \[ \int \csc ^2(c+d x) (a+b \sec (c+d x))^3 \, dx=\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (6\,a^2\,b+3\,b^3\right )}{d}-\frac {3\,a\,b^2-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^3+6\,a^2\,b+18\,a\,b^2+4\,b^3\right )+3\,a^2\,b+a^3+b^3+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (a^3+3\,a^2\,b+15\,a\,b^2-b^3\right )}{d\,\left (2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (a-b\right )}^3}{2\,d} \]

input
int((a + b/cos(c + d*x))^3/sin(c + d*x)^2,x)
 
output
(atanh(tan(c/2 + (d*x)/2))*(6*a^2*b + 3*b^3))/d - (3*a*b^2 - tan(c/2 + (d* 
x)/2)^2*(18*a*b^2 + 6*a^2*b + 2*a^3 + 4*b^3) + 3*a^2*b + a^3 + b^3 + tan(c 
/2 + (d*x)/2)^4*(15*a*b^2 + 3*a^2*b + a^3 - b^3))/(d*(2*tan(c/2 + (d*x)/2) 
 - 4*tan(c/2 + (d*x)/2)^3 + 2*tan(c/2 + (d*x)/2)^5)) + (tan(c/2 + (d*x)/2) 
*(a - b)^3)/(2*d)